package com.tanhua.dubbo.api;

import com.tanhua.model.mongo.TestList;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

import java.util.List;

@DubboService
public class TestSoulImpl implements TestSoulApi{
    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public void save(TestList TestList) {
        mongoTemplate.save(TestList);
    }

    @Override
    public List<TestList> getAll() {
        List<TestList> testLists = mongoTemplate.findAll(TestList.class);
        return testLists;
    }
}
